/********************************************************************
	created:	2012/12/29   15:03
	file base:	AccessFile
	file ext:	h
	author:		$wuxfei@gmail.com$
*********************************************************************/

// AccessFile.h: interface for the CAccessFile class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_ACCESSFILE_H__402A4BF2_E3F9_4528_9AEC_8AC35A3F9B6D__INCLUDED_)
#define AFX_ACCESSFILE_H__402A4BF2_E3F9_4528_9AEC_8AC35A3F9B6D__INCLUDED_

#ifdef _UTILITYEXT
#define UTILITY_EXT_CLASS __declspec(dllexport)
#else
#define UTILITY_EXT_CLASS __declspec(dllimport)
#endif

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMyODBC;
class UTILITY_EXT_CLASS CAccessFile  
{
public:
	CAccessFile(CString strFilePath);
	CAccessFile(void);

	virtual ~CAccessFile();

	BOOL OpenFile(CString strFilePath);
	BOOL QueryRecord(CString strSql);
	BOOL GetNextRecord(CStringArray &strArrayOneRow);
    BOOL GetNextRecord(CStringArray &strArrayOneRow, int &nColCount);
	void CloseQuery(void);
	
	BOOL ExecuteInsert(CString strTableName, const CStringArray &strArrayValues, const CStringArray &strArrayColName, int nColCount);
	BOOL ExecuteInsert(CString strSql);
	BOOL ExecuteDelete(CString strSql);
	BOOL ExecuteUpdate(CString strSql);

	BOOL DeleteAllRecord(CString strTableName);

private:
	CMyODBC *m_pStream;
};

#endif // !defined(AFX_ACCESSFILE_H__402A4BF2_E3F9_4528_9AEC_8AC35A3F9B6D__INCLUDED_)
